route.ts 349 B

123456789101112131415
  1. import { getAccount } from "@/lib/db/store";
  2. export async function GET(
  3. req: Request,
  4. { params }: { params: Promise<{ id: string }> },
  5. ) {
  6. const { id } = await params;
  7. const account = await getAccount(id);
  8. if (!account) {
  9. return Response.json({ error: "Account not found" }, { status: 404 });
  10. }
  11. return Response.json(account);
  12. }